//
//  ChatToolBar.h
//  ChatTool
//
//  Created by zhuxuehang on 13-10-9.
//  Copyright (c) 2013年 zhuxuehang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UIExpandingTextView.h"
#import "ISTThemeButton.h"
#import "EmotionView.h"

#define ChatToolBarMoved    @"ChatToolBarMoved"
#define SendChatMessage    @"SendChatMessage"
#define EmotionViewHidden @"EmotionViewHidden"
@class ChatToolBar;
@protocol ChatToolDelegate <NSObject>

@optional
-(NSString*)chatMessage:(ChatToolBar*)chatBar;
-(void) voicebtnDown:(id)sender;
-(void) voicebtnUpInside:(id)sender;
-(void) voicebtnDragExit:(id)sender;
-(void) voicebtnDragEnter:(id)sender;
-(void) voicebtnUpOutside:(id)sender;
-(void) sendMsg:(NSString *)txtMsg;

- (void)contentTextViewTextDidChangeWithText:(NSString *)text;
@end

@interface ChatToolBar : UIView<UITextFieldDelegate,
    UIExpandingTextViewDelegate,
    ThemeableDelegate, EmotionViewDelegate>
{
    ISTThemeButton *_moreBtn;
    ISTThemeButton *_emotionBtn;
    ISTThemeButton *_voiceChangeBtn;
    ISTThemeButton *_sendBtn;
    ISTThemeButton *_voiceBtn;

    UIExpandingTextView *_contentText;
    UIImageView *_contentTextBg;
    BOOL isVoiceShow;
    BOOL isEmotionShow;
    BOOL isMoreViewShow;
//    UIExpandingTextView *_contentText;
    __weak id<ChatToolDelegate>_chattoolDelegate;
    UIImageView* _imageView;
    CGFloat _KeyBoardHeight;
    CGFloat _proToolHeight;
    
    
    
}
AssignProperty NSRange textSelectRange;//用做记录
@property (nonatomic,retain) UIButton * moreBtn;
@property (nonatomic,retain) UIButton * emotionBtn;
@property (nonatomic,retain) UIButton * voiceChangeBtn;
@property (nonatomic,retain) UIButton * voiceBtn;
@property (nonatomic,retain) UIButton * sendBtn;
//@property (nonatomic,retain) UITextField *contentText;
@property (nonatomic,weak) id<ChatToolDelegate>chattoolDelegate;

@property (nonatomic,assign) BOOL isVoiceShow;
@property (nonatomic,assign) BOOL isEmotionShow;
@property (nonatomic,assign) BOOL isMoreViewShow;
+(ChatToolBar*)defaultChatToolBar;
@property (nonatomic,retain) UIExpandingTextView *contentText;
@property (nonatomic, copy) NSString *ChatText;
@property (nonatomic,retain) UIImageView* imageView;
@property (nonatomic ,assign) CGFloat proToolHeight;
@property (nonatomic, assign) BOOL isSendVoice;
@property (nonatomic, assign) CGFloat animateDuration;
@property (nonatomic, assign) UIViewAnimationCurve animateCurve;

- (void)btnUpInside:(id)sender;
-(void)reSetChatTool;
-(void)setOriginFrameOfTool;
-(void)setNewFrameOfTool;
- (ISTThemeButton *)buttonWithFrame:(CGRect)frame normalImg:(NSString*)normalImg selectedImg:(NSString*)selectedImg tag:(int)tagValue action:(SEL)sel;

- (void)resetToolPositionToInitial;


- (void)setPC_APPChatFrame;
- (void)setNormalChatFrame;


- (void)setCommentChatFrame;

- (void)resetCommentToolPositionToInitial;
@end



